package day08;

import java.util.Scanner;

/**
 * @author Xiao
 * @date 2021/7/9
 */
public class SubString {
    /**
     * 手机号屏蔽
     */
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        while (true) {
            System.out.println("请输入一个手机号(11位，如：13512341234)：");
            String s = sc.nextLine();
            System.out.println("------------");
            if (s.length() != 11) {
                System.out.println("您输入的手机号有误！");
            } else {
                String s1 = s.substring(0,3);
                String s2 = s.substring(7);
                System.out.println(s1 + "****" + s2);
                break;
            }
        }

    }
}
